package com.tenglong.teacher.ui.notiUtil;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.netease.nim.uikit.api.NimUIKit;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.tenglong.teacher.ui.utils.NimUtils;

import static com.tenglong.teacher.ui.utils.NimUtils.ANSWER_QESTION_TYPE;

public class NotificationActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        parseIntent();
        finish();
    }
    private void parseIntent(){
        if(getIntent().hasExtra(NotificationModule.NOTIFICATION_ACCID)
                && getIntent().hasExtra(NotificationModule.NOTIFICATION_SESSIONID)){
            String accid = getIntent().getStringExtra(NotificationModule.NOTIFICATION_ACCID);
            String seesionId = getIntent().getStringExtra(NotificationModule.NOTIFICATION_SESSIONID);
            IMMessage message = NimUtils.createSessionIdUtiMesssage(ANSWER_QESTION_TYPE,seesionId);
            NimUIKit.startP2PSession(this, accid,message);
        }

    }
}
